<?php

class Model extends Database{
	
	public function runQuery($sql){
		try {
			$query = $this->prepare($sql);
			return $query->execute();
		} catch(PDOException $e) {
			//enviar para o controlador error
			echo $e->getMessage();
		}
	}
	
	public function runSelect($sql){
		try {
		$query = $this->prepare($sql);
		$query->execute();
		return $query->fetchAll(PDO::FETCH_ASSOC);
		} catch(PDOException $e) {
			//enviar para o controlador error
			echo $e->getMessage();
		}
	}
	
	public function runEntrar($sql){
		try {
			$query = $this->prepare($sql);
			$query->execute();
			$query->fetchAll(PDO::FETCH_ASSOC);
			return $query->rowCount();
		} catch (PDOException $e) {
			//enviar para o controlador error
			echo $e->getMessage();
		}
	}
}

?>
	
	